<?php

  require_once "JooS/Server/Resource/DataNode.php";

  class JooS_Server_Resource_DataAttr extends JooS_Server_Resource_DataNode {
    public function __construct($name, $value) {
      parent::__construct($name);
      parent::__set("nodeValue", $value);
    }

    public function __set($name, $value) {
      switch ($name) {
        case "value":
          $name = "nodeValue";
          break;
      }
      parent::__set($name, $value);
    }

    public function __get($name) {
      switch ($name) {
        case "value":
          $name = "nodeValue";
          break;
        case "name":
          $name = "nodeName";
          break;
        case "nodeType":
          return self::DATA_ATTRIBUTE_NODE;
      }
      return parent::__get($name);
    }

    public public function __isset($name) {
      return ($name == "name" || $name == "value" ? true : parent::__isset($name));
    }

    public public function __unset($name) {
      switch ($name) {
        case "value":
          $name = "nodeValue";
          break;
        case "name":
          $name = "nodeName";
          break;
      }
      parent::__unset($name);
    }
  }

?>